import React, { Component } from 'react'
import Publish from "./utils/store"
import B from "./compnents/B"
export class Stroe extends Component {
    state={
        data:{
            name:"张三",
            age:18
        },
        flag:false
    }
    bin(){
        Publish.emit("emit",this.state.data)
        this.setState({flag:!this.state.flag})
    }
    render() {
        return (
            <div>
                Stroe
                <p onClick={this.bin.bind(this)}> 点我</p>
                {
                    this.state.flag === true ? <B/>:""
                }
            </div>
        )
    }
}

export default Stroe
